/*
* ECARX Technology Limited is the owner of the copyright and the trade secret of this software.
* Without permission, no one has the right to obtain, disclose or use this software in any way.
*/

package ecarx.xsf.notificationcenter.notification;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;


/**
 * FileName: INotificationBar.java <br>
 * Description : 形象消息数据类 <br>
 * Create Time: 2020/03/24 11:17 <br>
 * Update Time: 2021/8/3 14:07 <br>
 *
 * @since 1.0.0
 */
public class INotificationBar implements Parcelable {

    /**
     * 形象提示 id
     */
    private int id;

    /**
     * 包名
     */
    private String pkgName;

    /**
     * 通知标题
     */
    private String title;

    /**
     * 信息描述内容
     */
    private String content;

    /**
     * 是否 tts 播报
     */
    private boolean isTtsOn;

    /**
     * 是否开启可见即可说
     */
    private boolean seeSay;

    /**
     * 形象弹框样式
     */
    private String style;

    /**
     * 消息标识符
     */
    private String tag;

    /**
     * 消息唯一性
     */
    private String key;

    /**
     * 发送时间戳
     */
    private long when;

    /**
     * 通知按钮点击事件
     */
    private List<IPendingIntentAction> actions;

    /**
     * 可见即可说触发事件
     */
    private List<IPendingIntentAction> seeSayEventActions;


    public INotificationBar() {
    }

    public INotificationBar(int id, String pkgName, String title, String content, boolean isTtsOn, boolean seeSay, String style, String tag, String key, long when, List<IPendingIntentAction> actions, List<IPendingIntentAction> seeSayEventActions) {
        this.id = id;
        this.pkgName = pkgName;
        this.title = title;
        this.content = content;
        this.isTtsOn = isTtsOn;
        this.seeSay = seeSay;
        this.style = style;
        this.tag = tag;
        this.key = key;
        this.when = when;
        this.actions = actions;
        this.seeSayEventActions = seeSayEventActions;
    }

    protected INotificationBar(Parcel in) {
        id = in.readInt();
        pkgName = in.readString();
        title = in.readString();
        content = in.readString();
        isTtsOn = in.readByte() != 0;
        seeSay = in.readByte() != 0;
        style = in.readString();
        tag = in.readString();
        key = in.readString();
        when = in.readLong();
        actions = in.createTypedArrayList(IPendingIntentAction.CREATOR);
        seeSayEventActions = in.createTypedArrayList(IPendingIntentAction.CREATOR);
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(id);
        dest.writeString(pkgName);
        dest.writeString(title);
        dest.writeString(content);
        dest.writeByte((byte) (isTtsOn ? 1 : 0));
        dest.writeByte((byte) (seeSay ? 1 : 0));
        dest.writeString(style);
        dest.writeString(tag);
        dest.writeString(key);
        dest.writeLong(when);
        dest.writeTypedList(actions);
        dest.writeTypedList(seeSayEventActions);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<INotificationBar> CREATOR = new Creator<INotificationBar>() {
        @Override
        public INotificationBar createFromParcel(Parcel in) {
            return new INotificationBar(in);
        }

        @Override
        public INotificationBar[] newArray(int size) {
            return new INotificationBar[size];
        }
    };

    public String getStyle() {
        return style;
    }

    public void setStyle(String style) {
        this.style = style;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getPkgName() {
        return pkgName;
    }

    public void setPkgName(String pkgName) {
        this.pkgName = pkgName;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public boolean isTtsOn() {
        return isTtsOn;
    }

    public void setTtsOn(boolean ttsOn) {
        isTtsOn = ttsOn;
    }

    public boolean isSeeSay() {
        return seeSay;
    }

    public void setSeeSay(boolean seeSay) {
        this.seeSay = seeSay;
    }

    public String getTag() {
        return tag;
    }

    public void setTag(String tag) {
        this.tag = tag;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public long getWhen() {
        return when;
    }

    public void setWhen(long when) {
        this.when = when;
    }

    public List<IPendingIntentAction> getActions() {
        return actions;
    }

    public void setActions(List<IPendingIntentAction> actions) {
        this.actions = actions;
    }

    public List<IPendingIntentAction> getSeeSayEventActions() {
        return seeSayEventActions;
    }

    public void setSeeSayEventActions(List<IPendingIntentAction> seeSayEventActions) {
        this.seeSayEventActions = seeSayEventActions;
    }

}
